package com.zd.shopping.viewholder;

import android.content.Context;
import android.view.View;
import android.widget.TextView;

import com.zd.shopping.R;
import com.zd.shopping.bean.WmOmNoticeHEntity;
import com.zd.shopping.utils.RouterUtils;
import com.zwz.mall.listener.OnItemClickListener;
import com.zwz.mall.utils.ToastUtils;
import com.zwz.mall.viewholder.BaseViewHolder;

import butterknife.BindView;

/**
 * Created by 张默默 on 2020/3/13.
 */

public class NuclearGoodsViewHolder extends BaseViewHolder {
    @BindView (R.id.tv_state)
    TextView mTvstate;
    @BindView (R.id.tv_shopping_name)
    TextView mTv_shopping_name;
    @BindView (R.id.tv_quantity)
    TextView mTv_quantity;
    @BindView (R.id.tv_number)
    TextView mTv_number;
    public OnItemClickListener mOnItemClickListener;
    public NuclearGoodsViewHolder(View itemView) {
        super (itemView);
    }

    @Override
    public void bindView(int position, Object obj, Context context) {
        if (obj instanceof WmOmNoticeHEntity){
            WmOmNoticeHEntity wmOmNoticeHEntity = (WmOmNoticeHEntity) obj;
            mTvstate.setText (wmOmNoticeHEntity.getOmSta ());
            mTv_shopping_name.setText (wmOmNoticeHEntity.getCusCode ());
            mTv_number.setText (wmOmNoticeHEntity.getOmNoticeId ());
            mTv_quantity.setText ("("+wmOmNoticeHEntity.getOmBeizhu ()+"件)");
            itemView.setOnClickListener (new View.OnClickListener () {
                @Override
                public void onClick(View view) {
//                    ToastUtils.showShort (wmOmNoticeHEntity.getOmNoticeId ());
                    RouterUtils.openNumclearDetailsActivity (mContext,wmOmNoticeHEntity.getOmNoticeId ());
                }
            });
        }
    }
}
